import { History } from 'react-router';
//import TransitionHook from 'react-router/lib/TransitionHook';
import React from 'react';
import ReactMixin from 'react-mixin';

export function EnhancedNavigation(ComposedComponent) {

    @ReactMixin.decorate(History)
    class EnhancedNavigationC extends React.Component {
        static displayName = 'EnhancedNavigation';
        render() {
            var stateMixinApi = {
                getPath: this.getPath,
                getPathname: this.getPathname,
                getParams: this.getParams,
                getQuery: this.getQuery,
                isActive: this.isActive,
                getRoutes: this.getRoutes,
                transitionTo: this.transitionTo
            };
            return <ComposedComponent ref='component' {...this.props} {...stateMixinApi} routerState={stateMixinApi}/>;
        }
    }
    return EnhancedNavigationC;
    //return React.createClass({
    //    displayName: 'EnhancedNavigation',
    //    mixins: [State, Navigation],
    //
    //    render() {
    //        var stateMixinApi = {
    //            getPath: this.getPath,
    //            getPathname: this.getPathname,
    //            getParams: this.getParams,
    //            getQuery: this.getQuery,
    //            isActive: this.isActive,
    //            getRoutes: this.getRoutes,
    //            transitionTo: this.transitionTo
    //        };
    //
    //        return <ComposedComponent ref='component' {...this.props} {...stateMixinApi} routerState={stateMixinApi}/>;
    //    }
    //});
}
